import { Router, type IRouter } from 'express'
import playerRoutes from './playerRoutes'
import statisticsRoutes from './statisticsRoutes'
import groupingRoutes from './groupingRoutes'

const router: IRouter = Router()

// API 路由配置
router.use('/players', playerRoutes)           // 选手管理路由
router.use('/statistics', statisticsRoutes)   // 统计数据路由
router.use('/grouping', groupingRoutes)       // 分组管理路由

// API 根路径信息
router.get('/', (_req, res) => {
  res.json({
    message: 'Dx Fun Group API',
    version: '1.0.0',
    endpoints: {
      health: '/health',
      players: '/api/players',
      statistics: '/api/statistics'
    },
    documentation: '/api/docs'
  })
})

export default router
